Skip to content

Record the CCITT fixtures and what the first attempt established - #21

Merged
MPCoreDeveloper merged 2 commits into
mainfrom
docs/ccitt-fixtures
Nov 14, 2026
Merged

MPCoreDeveloper merged 2 commits into
mainfrom
docs/ccitt-fixtures

Conversation

@MPCoreDeveloper

Copy link
Copy Markdown
Owner

Summary

No production code: this records the data and the findings so the CCITT slice (the next one in ADR-005) starts from a fixture rather than from a description.

  • tests/.../Assets/parity/images/ccitt-g4.bin — 26 bytes, Group 4, a 16 x 16 bilevel fixture (a diagonal and a 6 x 6 block), written by Pillow 13.0.0 through libtiff.
  • ccitt-g3.bin — the same bitmap as Group 3 one-dimensional, 68 bytes.
  • ccitt-expected.txt — the 16 x 16 geometry and the 32-byte bitmap Pillow decodes (tobytes(), 1 is white).
  • docs/adr/0005-image-filter-decoders.md — the extraction method (the same one that produced lzw-tiff-strip.bin) and the two facts the first decoder attempt established:
    1. the raw bitmap is the complement of Pillow's tobytes(), so the test has to state the matching BlackIs1;
    2. a line may start with a zero-length white run, and a decoder that records only transitions after the first pixel shifts every later b1 — which is where the Group 4 fixture currently stops (line 12).

Why no decoder

The first attempt decoded the Group 4 fixture's first twelve lines correctly and then failed on the 2D transition parity. Committing a half-working decoder would wire a broken filter into samples, so it is reverted; the fixture and the findings are the durable part.

Evidence

  • dotnet build -c Release → 0 warnings, 0 errors; dotnet test → 1234 passed, 0 failed on each leg (no test changed).

Two Pillow-written strips and the bitmap they must produce are committed beside the other image fixtures,
with the TIFF-strip extraction method and the two facts the decoder attempt established: the raw bitmap is
the complement of Pillow tobytes(), and a line may start with a zero-length white run whose transition at
0 shifts every later b1 if it is not recorded.

No production code: the CCITT decoder is the next slice, and this commit makes it start from data.
@MPCoreDeveloper
MPCoreDeveloper merged commit 18278be into main Nov 14, 2026
8 checks passed
@MPCoreDeveloper
MPCoreDeveloper deleted the docs/ccitt-fixtures branch November 14, 2026 22:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant